<template>
    <div>
        <h1>{{type}}{{mycount}}{{mycount2}}{{count3}}</h1>

        <my-a></my-a>
        <my-b/>
        <!-- <input type="text" v-model="$store.state.count"> -->
    </div>
</template>
<script>
// @ is an alias to /src
import a from './components/a'
import b from './components/b'
import {mapState,mapGetters} from 'vuex'
// 辅助函数
export default {
    name: 'XXX',
    data() {
        return {
        
        }
    },
    created() {
      console.log('index',this)
    },
    computed:{
      // type(){
      //   return this.$store.getters.type
      // },
      count3(){
        return this.$store.state.count + 'qqqq'
      },
      // ...mapState(['count']),
      ...mapState({
        mycount:'count',
        mycount2:function(state){
          return state.count + 100;
        }
      }),
      ...mapGetters(['type'])
    },
    components: {
        'my-a':a,
        'my-b':b
    }
}
</script>
<style lang="less">

</style>